package com.nuoniu.sibanyun.controller.mobile;


import com.nuoniu.sibanyun.common.BaseController;
import com.nuoniu.sibanyun.common.result.HttpResult;
import com.nuoniu.sibanyun.entity.crm.CrmDefineField;
import com.nuoniu.sibanyun.service.crm.ICrmDefineFieldService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 客户管理自定义字段（APP端 ）
 * </p>
 *
 * @author baiqiang
 * @since 2020-06-15
 */
@RestController
@RequestMapping("/app/crm/defineField")
@Api(value="客户管理自定义字段 ",tags={"APP_自定义字段"})
public class AppCrmDefineFieldController extends BaseController {

    @Autowired
    private ICrmDefineFieldService defineFieldService;

    /**
     * 获取自定义字段
     */
    @GetMapping("list")
    @ApiOperation(value = "获取当前租户字段列表",tags = "APP_个人中心")
    @ApiImplicitParams({
            @ApiImplicitParam(name="source",value="字段来源  crm:客户,linkMan:联系人,touch:类型记录,business:商机",required=true,paramType="query"),
    })
    public HttpResult<List<CrmDefineField>> getDefineFieldList(String source) {
        return HttpResult.ok( defineFieldService.getDefineFieldListApp(source));
    }

}
